package com.tengtong.duang.commons.utils.helper;

import java.lang.annotation.Annotation;

import com.tengtong.duang.commons.base.ClassFilter;


/**
 * 注解过滤器
 * 
 * 过滤存在某个 Annotation 注解的 class 
 *
 *
 * @author Jai
 * @since: v1.0
 */
public class AnnotationFilter implements ClassFilter{

	private final Class<? extends Annotation> annotation;
	
	public AnnotationFilter(Class<? extends Annotation> annotation) {
		this.annotation = annotation;
	}

	@Override
	public boolean test(Class<?> clazz) {
		if(clazz != null)
			return clazz.isAnnotationPresent(annotation);
		return false;
	}

}
